package com.example.forum.interceptor;

import com.example.forum.entity.Token;

//登录之后的用户信息
public class TokenContext {
    //    private static User current;不是线程安全的
    private static final ThreadLocal<Token>current =new ThreadLocal<>();
    public static void setToken(Token token){
//        current=user;
        current.set(token);
    }
    public  static Token getToken(){
//        return current;
        return current.get();
    }
}